
fun getTemperature(city:String):Double{
    println("fetch webservice for $city")
    return 30.0
}

val showTemp = false
val city = "Bundler"
//
//if(showTemp && getTemperature(city) > 20){
//    println("warm")
//}else{
//    println("nothing to report")
//}
//
//val temprature = getTemperature(city)
//if(showTemp && temprature > 20){
//    println("warm")
//}else{
//    println("nothing to report")
//}

val lazyTemprature by lazy { getTemperature(city) }
if(showTemp && lazyTemprature > 20){
    println("warm")
}else{
    println("nothing to report")
}